草庐IT

git - 无法连接到github 443

全部标签

go - 无法安装 gotk3,出现 GdkMonitor 错误

我尝试使用gotk3创建桌面应用程序。我按照gotk3wiki中的说明进行操作还有这个installing-on-linuxwiki安装它。但是后来我在执行goget-v时遇到了这个错误:gccerrorsforpreamble:Infileincludedfrom../../gotk3/gotk3/gdk/gdk_since_3_22.go:23:0:./gdk_since_3_22.go.h:22:8:error:unknowntypename'GdkMonitor'staticGdkMonitor*^我已经尝试删除gotk3目录,然后再次尝试goget-v,但仍然没有用。我还使用

docker 无法运行已经存在的 go 输出文件

我正在为我的go项目构建一个多阶段Dockerfile。FROMgolang:latestasbuilderCOPY./go.mod/app/go.modCOPY./go.sum/app/go.sum#exportinggo1.11modulesupportvariableENVGO111MODULE=onWORKDIR/app/#createvendordirectoryRUNgomoddownloadCOPY./app/RUNgomodvendor#buildingsourcecodeRUNgobuild-mod=vendor-omain-v./src/FROMalpine:lat

postgresql - 如何从 Go 中的 Cloud Function 连接到 Cloud-SQL?

对于一个项目,我正在尝试将云功能连接到云sql数据库设置,如thisquickstartguide中所述。.该功能配置在同一区域,服务帐户具有角色CloudSQL-Client。我通过我的计算机调用函数是这样的:gcloudfunctionscall--region=--data'{"recipient":"hello","requester":"hello","message":"test"}'与函数的连接正常,似乎只是对数据库的身份验证不起作用,但我不知道我失败的地方。我多次检查了密码、用户和连接名,重设了密码,还是不行。我发现了问题here与将云功能连接到云sql相关。我尝试用单

go - 异常大量的 TCP 连接超时错误

我正在使用GoTCP客户端连接到我们的GoTCP服务器。我能够连接到服务器并正确运行命令,但是在尝试连接到我们的TCP服务器或发送消息时,我的TCP客户端经常会报告异常大量的连续TCP连接错误一旦连接:dialtcpkubernetes_node_ip:exposed_kubernetes_port:connectex:Aconnectionattemptfailedbecausetheconnectedpartydidnotproperlyrespondafteraperiodoftime,orestablishedconnectionfailedbecauseconnectedho

go - 为什么客户端通过 http.ServeContent 阅读我的视频时一直关闭连接?

我目前正在做一个小项目,通过http.ServeContent向浏览器或其他媒体客户端提供视频服务。我已经实现了自己的ReadSeeker,如下所示://theseekisnotfullyworkingyetbutworksfinefortheinitialtwocallsthatisbeingcalledinternallyfromhttptodecidethefilesize.func(c*Client)Seek(offsetint64,whenceint)(tint64,eerror){switchwhence{case0:t=offsetcase1:t=c.seek+offse

go - 无法将本地包调用到 main

我觉得这可能是一个关于SO的问题,但又出现了。我发现这个简单的任务在Go中非常乏味。请注意,我将GO11MODULES设置为ON,我不确定这是否会影响整个包系统(这不应该是我所假设的)。我有一个名为“users”的包,其中包含一个已编译的ProtocolBuffer(来自.proto文件)。我想将它与许多其他定义一起存储在名为protos的文件夹中。所以我的结构看起来像这样:-main.go-protos-users.go-users.proto-analytics.go-analytics.proto非常简单的结构。在users.go文件中,我定义了packageprotos。在ma

go - 在本地使用 k8s go-client 连接到集群

我想运行GoK8S客户端库并使用我本地定义的kubeconfig连接到集群mac下/Users/i0334456/.kube/config错误是:#k8s-go-client/vendor/k8s.io/client-go/restvendor/k8s.io/client-go/rest/request.go:598:31:notenoughargumentsincalltowatch.NewStreamWatcherhave(*versioned.Decoder)want(watch.Decoder,watch.Reporter)这是我尝试使用的程序packagemainimport

postgresql - 连接 : connection timed out

我已经使用gosql包成功连接到Postgres数据库:...db,err:=sql.Open("postgres",connStr)然后我使用返回的数据库执行(长时间运行的)查询:rows,err:=db.Query(...)我得到了错误:dialtcpxx.xxx.xxx.xx:5432:connect:connectiontimedout我有几个问题:为什么连接超时?我能做些什么来防止它超时吗? 最佳答案 sql.Open()mayjustvalidateitsargumentswithoutcreatingaconnecti

go - 无法在ubuntu中为golang编译proto文件

我已经安装了这些包:google.golang.org/grpcgithub.com/golang/protobuf/protoc-gen-go导出路径如下:exportPATH=$PATH:/usr/local/go/bin当我尝试使用protoc命令编译proto文件时,我看到命令未找到错误:protoc--go_out=.helloworld/helloworld.protozsh:commandnotfound:protoc我的项目路径是这样的:/home/my-username/go/src/github.com/my-username/helloworld我的go版本:go

go - 运行 "go get github.com/libp2p/go-libp2p"导致错误消息

我是golang的初学者。当尝试运行“gogetgithub.com/libp2p/go-libp2p”时,我收到一条错误消息,使我无法运行测试和基准测试。这里是错误:github.com/libp2p/go-libp2p/p2p/host/routed../../libp2p/go-libp2p/p2p/host/routed/routed.go:153:20:cannotuserh.host.Mux()(type"github.com/libp2p/go-libp2p-core/protocol".Switch)astype*multistream.MultistreamMuxer